package org.fisco.bcos.asset.service.impl;


import java.math.BigInteger;

import lombok.SneakyThrows;
import org.fisco.bcos.asset.client.CharityDonationClient;

import org.fisco.bcos.asset.resp.DonationSummary;
import org.fisco.bcos.asset.service.BeneficiaryService;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple3;
import org.fisco.bcos.sdk.model.TransactionReceipt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class BeneficiaryServiceImpl extends CharityServiceImpl implements BeneficiaryService {

    @Autowired
    private CharityDonationClient charityDonationClient;

    @Override
    public void submitApplication(String description, BigInteger requestedAmount) {
        charityDonationClient.submitApplication(description, requestedAmount);
    }

    @SneakyThrows
    @Override
    public DonationSummary getBeneficiaryStats(String beneficiaryAddress) {
        return charityDonationClient.getBeneficiaryStats(beneficiaryAddress);
    }
}